<template>
	<view class="diy-seckillProduct" v-if="itemData.data.product_list.length>0">
		<view class="sharpproduct-head d-b-c"
			:style="'background-image: url('+itemData.style.background_image+');'">
			<view class="left d-s-c">
				<view class="name d-c-c">
				</view>
			</view>
			<view class="right d-e-c" @click="gotoList">
				<text class="f26" style="color: #fff;">更多</text>
				<text class="iconfont icon-jiantou mr10"></text>
			</view>
		</view>
		<view class="fff_box">
			<view class="product" v-for="(item, index) in itemData.data.product_list" :key="index" @click="gotoDetail(item.product_id)">
				<view class="product_img">
					<image :src="item.product.file_path" mode="aspectFill"></image>
				</view>
				<view class="product_main">
					<view class="product_name">
						{{item.product.product_name}}
					</view>
					<view class="product_slider">
						<view class="slider_box">
							<slider v-model="item.product_sales" :max="item.stock" disabled :block-size="12" />
						</view>
						<view class="slider_num">
							已抢{{item.product_sales}}
						</view>
					</view>
					<view class="product_price">
						<view class="">
							<text class="aaa">￥{{ item.seckill_price }}</text>
							<text class="bbb">￥{{ item.product_price }}</text>
						</view>
						<view class="">
							<view class="ccc">
								去抢购
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import Countdown from '@/components/countdown/countdown-act.vue';
	export default {
		components: {
			Countdown
		},
		data() {
			return {
				/*倒计时配置*/
				countdownConfig: {
					/*开始时间*/
					startstamp: 0,
					/*结束时间*/
					endstamp: 0,
					/*标题*/
					title: ' '
				}
			};
		},
		props: ['itemData'],
		created() {
			this.countdownConfig.endstamp = this.itemData.data.end_time;
			this.countdownConfig.startstamp = this.itemData.data.start_time;
		},
		methods: {
			scroll(e) {},

			/*跳转列表*/
			gotoList() {
				let url = '/pages/plus/seckill/list/list';
				this.gotoPage(url);
			},

			/*跳转产品详情*/
			gotoDetail(e) {
				let url = '/pages/product/detail/detail?product_id=' + e;
				this.gotoPage(url);
			}
		}
	};
</script>

<style lang="scss">
	.fff_box {
		width: 710rpx;
		background-color: #fff;
		padding: 0 20rpx;

		.product {
			padding: 20rpx 0;
			display: flex;
			align-items: center;

			.product_img {
				width: 160rpx;
				height: 160rpx;

				image {
					width: 160rpx;
					height: 160rpx;
					border-radius: 12rpx;
				}
			}

			.product_main {
				width: 484rpx;
				padding-left: 20rpx;

				.product_name {
					font-size: 28rpx;
					color: #333333;
				}

				.product_slider {
					display: flex;
					align-items: center;

					.slider_box {
						width: 360rpx;
					}

					.slider_num {
						color: #999;
						font-size: 24rpx
					}
				}

				.product_price {
					display: flex;
					align-items: center;
					justify-content: space-between;

					.aaa {
						color: #ED4549;
						font-size: 28rpx;
						font-weight: bold;
					}

					.bbb {
						font-size: 24rpx;
						color: #999;
						padding-left: 20rpx;
					}

					.ccc {
						width: 120rpx;
						height: 48rpx;
						line-height: 48rpx;
						text-align: center;
						border-radius: 24rpx;
						font-size: 28rpx;
						color: #fff;
						background-color: #ED4549;
					}
				}
			}
		}
	}

	.diy-seckillProduct {
		margin: 20rpx 20rpx;
		border-radius: 6rpx;
		overflow: hidden;
		box-shadow: 0px 8rpx 3rpx 0px rgba(6, 0, 1, 0.03);
	}

	.diy-seckillProduct .sharpproduct-head {
		height: 90rpx;
		color: #000000;
		background-size: 100% 100%;
	}

	.diy-seckillProduct .name {
		width: 200rpx;
	}

	.diy-seckillProduct .sharpproduct-body {
		padding: 0 20rpx;
	}

	.diy-seckillProduct .sharpproduct-head .name {
		font-size: 32rpx;
		font-weight: bold;
	}

	.diy-seckillProduct .sharpproduct-head .datetime::v-deep text {
		font-size: 24rpx;
		color: #ffffff;
	}

	.diy-seckillProduct .sharpproduct-head .datetime::v-deep .box {
		padding: 4rpx 10rpx;
		font-size: 22rpx;
		background: #FFEBEB;
		color: #EE1413;
	}

	.diy-seckillProduct .sharpproduct-head .icon-jiantou {
		margin-left: 8rpx;
		color: #fff;
		font-size: 22rpx;
	}

	.diy-seckillProduct .product-list .product-item {
		overflow: hidden;
		flex-shrink: 0;
	}

	.diy-seckillProduct .product-list .product-cover image {
		width: 100%;
		height: 100%;
		background-color: #F4F4F4;
		border-radius: 12rpx;
	}

	.diy-seckillProduct .product-list .price {
		font-size: 20rpx;
		color: #F01A1A;
		line-height: 26rpx;
		padding-top: 16rpx;
		padding-bottom: 8rpx;
	}

	.diy-seckillProduct .product-list .product-title {
		margin-top: 26rpx;
		height: 30rpx;
		line-height: 30rpx;
		display: -webkit-box;
		overflow: hidden;
		-webkit-line-clamp: 1;
		-webkit-box-orient: vertical;
		font-size: 30rpx;
	}

	.diy-seckillProduct .column__3 .product-list .product-title {
		font-size: 28rpx;
	}

	.diy-seckillProduct .column__3 .product-list {
		display: flex;
		flex-wrap: nowrap;
		justify-content: flex-start;
	}

	.diy-seckillProduct .column__3 .product-item {
		width: 132rpx;
		margin-right: 46rpx;
		border-radius: 6rpx;
		overflow: hidden;
		margin-top: 20rpx;
		padding-bottom: 16rpx;
	}

	.diy-seckillProduct .column__3 .product-cover {
		width: 132rpx;
		height: 132rpx;
		margin: 0 auto;
		margin-bottom: 16rpx;
	}

	.diy-assembleproduct .product-list {
		flex-wrap: nowrap;
	}
</style>